package org.imast.actions;

import java.util.ArrayList;
import java.util.List;

import org.imast.models.ModelProduct;
import org.imast.services.ServiceProduct;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class ActionProducts extends ActionSupport implements ModelDriven<ModelProduct>{
	
	private ModelProduct product = new ModelProduct();
	private List<ModelProduct> listProduct = new ArrayList<ModelProduct>();
	private ServiceProduct serviceProduct = new ServiceProduct();
	
	public String getAll(){
		
		listProduct = serviceProduct.getAll();
		
		return SUCCESS;
		
	}

	public ModelProduct getProduct() {
		return product;
	}

	public void setProduct(ModelProduct product) {
		this.product = product;
	}

	public List<ModelProduct> getListProduct() {
		return listProduct;
	}

	public void setListProduct(List<ModelProduct> listProduct) {
		this.listProduct = listProduct;
	}

	@Override
	public ModelProduct getModel() {
		// TODO Auto-generated method stub
		return product;
	}

}
